package me.m1key.springtx.entities;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "SERVICE_IDENTIFICATION")
public class ServiceIdentificationBean {
	private Long id;
	private String title;
	private String spAbstract;
	private List<String> keywords = new ArrayList<String>();
	private String serviceType;
	private String serviceTypeVersion;
	private String fees;
	private List<String> accessConstraints = new ArrayList<String>();	
	

	public ServiceIdentificationBean() {
		super();
	}

	@Id
	@GeneratedValue
	@Column(name = "SP_ID")
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "SP_ABSTRACT")
	public String getSpAbstract() {
		return this.spAbstract;
	}

	public void setId(String spAbstract) {
		this.spAbstract = spAbstract;
	}
	
	@Column(name = "SP_SERVICETYPE")
	public String getServiceType() {
		return this.serviceType;
	}

	public void setServiceType(String serviceType) {
		this.serviceType = serviceType;
	}
	
	@Column(name = "SP_SERVICETYPE_VERSION")
	public String getServiceTypeVersion() {
		return this.serviceTypeVersion;
	}

	public void setServiceTypeVersion(String serviceTypeVersion) {
		this.serviceTypeVersion = serviceTypeVersion;
	}

	@Column(name = "SP_NAME")
	public String getProviderName() {
		return this.title;
	}

	public void setProviderName(String name) {
		this.title = name;
	}
	
	@ElementCollection(fetch = FetchType.EAGER)
	public List<String> getKeywords() {
		return this.keywords;
	}

	public void setKeywords(List<String> keywords) {
		this.keywords = keywords;
	}
	
	@ElementCollection(fetch = FetchType.EAGER)
	public List<String> getAccessConstraints() {
		return this.accessConstraints;
	}

	public void setAccessConstraints(List<String> accessConstraints) {
		this.accessConstraints = accessConstraints;
	}
	
	@Column(name = "SP_FEES")
	public String getProviderFees() {
		return this.title;
	}

	public void setProviderFees(String fees) {
		this.fees = fees;
	}
	

	@Override
	public String toString() {
		return "[" + id + ", " + title + "]";
	}
}
